﻿using OneRed.Nodes;
using System.ComponentModel;

namespace OneRed.Edges
{
    public class Edge : INotifyPropertyChanged
    {
        //边上的数字或内容
        public string EdgeText { get; set; }

        private Node from;
        public Node From
        {
            get
            {
                return from;
            }
            set
            {
                from = value;
                OnPropertyChanged("From");
            }
        }


        private Node to;
        public Node To
        {
            get
            {
                return to;
            }
            set
            {
                to = value;
                OnPropertyChanged("To");
            }
        }
        private double thinck;
        public double Thinck
        {
            get
            {
                return thinck;
            }
            set
            {
                thinck = value;
                OnPropertyChanged("Thinck");
            }
        }

        private double opacity;
        public double Opacity
        {
            get
            {
                return opacity;
            }
            set
            {
                opacity = value;
                OnPropertyChanged("Opacity");
            }
        }
        private string stroke;
        public string Stroke
        {
            get
            {
                return stroke;
            }
            set
            {
                stroke = value;
                OnPropertyChanged("Stroke");
            }
        }



        public event PropertyChangedEventHandler PropertyChanged;

        private void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
